<?php
$items = $query->fetchAll();
/*if(!empty($items[0]['category_name'])){
	$catname = ' in ' . $items[0]['category_name'];
}*/
?>

<h1><?php echo __('Items') ?> <?php echo (isset($catname)) ? $catname : ''; ?></h1>

<p>

<?php
foreach($items as $item){
?>

<div style="border:1px solid #CFCFCF; height:85px; width:110px; float:left; margin-left:10px; margin-bottom:20px;">
	<div id="pgallery_cat_item_<?php echo $item->item_id ?>" class="pgallery_cat_item" style="background:url({$image_url}tb_{$image->photo_filename}) no-repeat left top;">
		<div  class="cat_d">
			<p style="pgallery_item_actions">
				<strong><?php echo $item->name ?></strong><br />
				<a href="<?php echo get_url('plugin/pgallery/edit_item/'.$item->slug) ?>"><?php echo __('Edit') ?></a> | 
				<a href="<?php echo get_url('plugin/gallery/delete_item/'.$item->slug) ?>"><?php echo  __('Delete') ?></a>
			</p>
		</div>
	</div>
</div>

<?php
}

echo ($query->rowCount() == 0) ? 'No items have been added to this category yet.' : '';



/*
	<li id="item_<?php echo $item->item_id; ?>" class="layout node <?php echo odd_even(); ?>">
		<img align="middle" alt="layout-icon" src="<?php echo URL_PUBLIC; ?>frog/plugins/pgallery/images/category.png" title="" />
		<a href="<?php echo get_url('plugin/pgallery/items/'.$cat->slug); ?>"><?php echo $cat->name; ?></a>
		<div class="remove"><a href="<?php echo get_url('plugin/pgallery/delete_category/'.$cat->category_id); ?>" onclick="return confirm('<?php echo __('Are you sure you wish to delete'); ?> <?php echo $cat->name; ?>?');"><img alt="<?php echo __('Remove category'); ?>" src="images/icon-remove.gif" /></a></div>
	</li>
*/
?>

</p>


<script type="text/javascript">
	// frog download box & description
	$$(".pgallery_item_actions").each(function(e){
		e.observe('mouseover', alert(e.id));
		});
</script>